
/*****************************************************************************/
/* @file     main.c
 * @author   username     
 * @version  v0
 * @date     Septemper 2020
 * @brief    Simple function in C, Ansi-style

 * Copyright (C) 2020 Hangzhou SDIC Microelectronics Co., Ltd*/

/******************************************************************************/
/**
 * @brief the main entry of the application; when run to here, the system has been initialized includes:
 * 1 CPU processor status register
 * 2 CPU vector base register
 * 3 CPU Units such as MGU, Cache...
 * 4 IO base address
 *
 * @return For MCU application, it's better to loop here
 */

#include "define.h"
#include "disp.h"
#include "power.h"
#include "clk.h"
#include "gpio.h"
#include "time.h"
#include "uart.h"
#include "spk.h"
#include "flash.h"
#include "adc.h"
#include "algo.h"
#include "bp.h"
#include "func.h"
#include "op.h"
#include "pwm.h"

stateFlag_typedef stateFlag;
 
void Initialization(void)
{
	Osc_Setup_CR();
	//RCC_ClockOut(RCC_CLKOUT_SYSCLK,ENABLE);//RCC_CLKOUT_ILRC
	UserPower_Init();
	UserVIC_Init();	
	UserGPIO_Init();
	//UserLCD_Init();
	UserSARADC_LBT_Init();
	UserSDADCInit();
    UserEXINT_Init();
	UserRtc_Init();
	UserTimer0_Init();
	User_Uart0_Init();
	BZ_Init();
	
}
void nopdelay(void);
extern uint32 delaytest;
int  main(void)
{
	Osc_Setup_CR();
	UserRtc_Init();
	initial();
 	InitialLoop();

	delaytest=100000;
	nopdelay();
	SoundCommand(0xB6);
	if((VoiceType==1) && (VoiceType2==2))	//20230510 for default MD voice
	{
		VoiceFlag=1		;
		SoundAllCommand(0x22,0,0,0);	//MD							
	}
	
	Bp_Work();		
}
